<?php
session_start();
header('Content-Type: text/html; charset=iso-8859-1');
require_once($_SESSION['idioma']);

include_once("../../classes/ModulsHoraris.class.php");

if (($_GET["hora_ent"] > -1) && ($_GET["hora_sal"] > -1) && ($_GET["min_ent"] > -1) && ($_GET["min_sal"] > -1)) {
	$hora_ent = $_GET["hora_ent"];
	$min_ent = $_GET["min_ent"];
	$hora_sal = $_GET["hora_sal"];
	$min_sal = $_GET["min_sal"];

	$entrada= $hora_ent.":".$min_ent;
	$sortida= $hora_sal.":".$min_sal;

	$bd=new ModulsHoraris();
	$retorn=$bd->crearModul($entrada,$sortida);	
		
	if ( $retorn == true){
		echo "<p style='color:#000000'>".$idioma['introduccio_ok']."</p>";
	} else {
		echo "<p style='color:#FF0000'>".$idioma['introduccio_ko']."</p>";
	}
} else {
	echo "<p style='color:#FF0000'>".$idioma['introduccio_no']."</p>";
}
?>